<html>
<head><meta charset="utf-8"><title>Reusing error codes · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html">Reusing error codes</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="183277547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183277547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183277547">(Dec 12 2019 at 16:45)</a>:</h4>
<p>I'm looking at making a new error that would naturally fit in between two existing codes (namely E0222). That one is commented out with <code>Error code E0045 (variadic function must have C or cdecl calling convention) duplicate</code>. Googling around doesn't show any real results about it. It was never part of the index. The new error would be a more targeted subset of E0221 and E0224. Should I not worry and just use a new error code, even though that would put the documentation for it far away from related issues?<br>
Normally I don't care, but in this case I'm tempted at reusing it.</p>



<a name="183278212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183278212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183278212">(Dec 12 2019 at 16:51)</a>:</h4>
<p>Looks like it was commented out in June 2015 (<a href="https://github.com/rust-lang/rust/issues/26503" target="_blank" title="https://github.com/rust-lang/rust/issues/26503">#26503</a>).</p>



<a name="183279332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183279332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183279332">(Dec 12 2019 at 17:02)</a>:</h4>
<p>Indeed, it seems like one of those rare cases where there wouldn't be a real conflict (but as a matter of policy, it feels icky to mess around with this because I don't want to <em>endorse</em> doing this)</p>



<a name="183363285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183363285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183363285">(Dec 13 2019 at 14:27)</a>:</h4>
<p>i personally recommend using a new error code</p>



<a name="183363410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183363410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183363410">(Dec 13 2019 at 14:28)</a>:</h4>
<p>Its possible that we should have a hierarchy of error codes, but we don't, and I think error code reuse in the fashion you describe will only lead people to mistakenly think the numbers are significant.</p>



<a name="183365555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183365555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183365555">(Dec 13 2019 at 14:50)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> I do not believe that the "numbering" is meaningful in any particular way</p>



<a name="183365601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183365601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183365601">(Dec 13 2019 at 14:50)</a>:</h4>
<p>So yes, what <span class="user-mention" data-user-id="116083">@pnkfelix</span> said, I guess</p>



<a name="183375100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183375100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183375100">(Dec 13 2019 at 16:25)</a>:</h4>
<p>FWIW, this is the code I wanted to add <a href="https://github.com/rust-lang/rust/pull/67268/files#diff-7f976ff24a89d1a1719487d8e7b1e5f7" target="_blank" title="https://github.com/rust-lang/rust/pull/67268/files#diff-7f976ff24a89d1a1719487d8e7b1e5f7">https://github.com/rust-lang/rust/pull/67268/files#diff-7f976ff24a89d1a1719487d8e7b1e5f7</a></p>



<a name="183375189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183375189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183375189">(Dec 13 2019 at 16:26)</a>:</h4>
<p>I would also like some holes poked into it because I feel that there should be more conditions for that one case to be triggered</p>



<a name="183611917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183611917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183611917">(Dec 17 2019 at 02:21)</a>:</h4>
<p>people have mentioned it before, but has there been a serious discussion about moving to more meaningful (non-numeric) error codes?</p>



<a name="183613362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183613362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183613362">(Dec 17 2019 at 03:02)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> you might be interested in <a href="https://github.com/rust-lang/rust/issues/67068" target="_blank" title="https://github.com/rust-lang/rust/issues/67068">https://github.com/rust-lang/rust/issues/67068</a></p>



<a name="183613367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183613367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183613367">(Dec 17 2019 at 03:03)</a>:</h4>
<p>but I think the loose summary -- that I need to write up -- is "we have many existing users who use the current error codes"</p>



<a name="183613368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183613368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183613368">(Dec 17 2019 at 03:03)</a>:</h4>
<p>that makes it hard to migrate/change effectively</p>



<a name="183613413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183613413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183613413">(Dec 17 2019 at 03:04)</a>:</h4>
<p>and any new solution I think needs to be obviously and significantly better, because otherwise the existing is "too good" (due to being existing, not on its own merits)</p>



<a name="183697661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183697661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183697661">(Dec 17 2019 at 22:16)</a>:</h4>
<p>ah, I haven't been able to keep up with the meetings recently, thanks for writing that issue up</p>



<a name="183697682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183697682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183697682">(Dec 17 2019 at 22:17)</a>:</h4>
<p>that makes sense</p>



<a name="183697701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183697701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183697701">(Dec 17 2019 at 22:17)</a>:</h4>
<p>we probably ought to be stricter about how error codes are used now, because I think they have been repurposed in the past</p>



<a name="183697706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183697706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183697706">(Dec 17 2019 at 22:17)</a>:</h4>
<p>but that was probably all discussed, so I'll catch up before adding anything else</p>



<a name="183698141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183698141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183698141">(Dec 17 2019 at 22:22)</a>:</h4>
<p>we have not had any official meetings on this I think</p>



<a name="183698146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183698146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183698146">(Dec 17 2019 at 22:22)</a>:</h4>
<p>just some ad-hoc discussion in discord</p>



<a name="183698153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Reusing%20error%20codes/near/183698153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Reusing.20error.20codes.html#183698153">(Dec 17 2019 at 22:22)</a>:</h4>
<p>which didn't have all stakeholders present for sure</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>